Setting up the environment and installing libraries

In this project, to build an AI app, you will use Gradio interface provided by Hugging Face.

Let's set up the environment and dependencies for this project. Open up a new terminal and make sure you are in the home/project directory.

Open a new terminal:

open terminal
Open a new terminal

Create a Python virtual environment and install Gradio using the following commands in the terminal:

  1. 1
  2. 2
  3. 3
  1. pip3 install virtualenv
  2. virtualenv my_env # create a virtual environment my_env
  3. source my_env/bin/activate # activate my_env

Then, install the required libraries in the environment:

  1. 1
  2. 2
  1. # installing required libraries in my_env
  2. pip install langchain==0.1.11 gradio==4.44.0 transformers==4.38.2 bs4==0.0.2 requests==2.31.0 torch==2.2.1

Have a cup of coffee, it will take 5 minutes.

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  1. ) (
  2. ( ) )
  3. ) ( (
  4. _______)_
  5. .-'---------|
  6. ( C|/\/\/\/\/|
  7. '-./\/\/\/\/|
  8. '_________'
  9. '-------'

Now, your environment is ready to create Python files.